n = 1000
r=1
for i in range(1,n+1):
    r*=i
print("{}的阶乘为{}".format(n, r))
print("{}的阶乘有{}位十进制数字".format(n,len(str(r))))
b=bin(r)
print("{}的阶乘二进制形式为{}".format(n,b))
print("{}的阶乘有{}位二进制数字".format(n,len(b)-2))